define([
        'app',
        './API'
    ],
    function (app) {
        'use strict';
        app.factory('CardAPI', ['API', '$rootScope', '$localForage', '$resource',
            function (API, $rootScope, $localForage, $resource) {
                var _API = new API('card');
                var server = _API.server;

                return angular.extend(_API, {
                    getCode: function (query) {
                        return $resource(server + '/code/get').get(query).$promise;
                    }
                });
            }
        ]);
    });
